home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / ADA / GNAT / !gcc / adainc / 6 / ads / s-stoele < prev    next >
Text File  |  1996-02-12  |  3KB  |  74 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --               S Y S T E M . S T O R A G E _ E L E M E N T S              --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.17 $                             --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. package System.Storage_Elements is
  19. pragma Pure (Storage_Elements);
  20. --  Note that we take advantage of the implementation permission to make
  21. --  this unit Pure instead of Preelaborable; see RM 13.7.1(15).
  22.  
  23.    type Storage_Offset is range
  24.      -(2 ** (Standard'Address_Size - 1)) ..
  25.      +(2 ** (Standard'Address_Size - 1)) - 1;
  26.  
  27.    subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last;
  28.  
  29.    type Storage_Element is mod 2 ** Storage_Unit;
  30.    for Storage_Element'Size use Storage_Unit;
  31.  
  32.    type Storage_Array is
  33.      array (Storage_Offset range <>) of aliased Storage_Element;
  34.    for Storage_Array'Component_Size use Storage_Unit;
  35.  
  36.    --  Address arithmetic
  37.  
  38.    function "+" (Left : Address; Right : Storage_Offset) return Address;
  39.    pragma Convention (Intrinsic, "+");
  40.    pragma Inline ("+");
  41.  
  42.    function "+" (Left : Storage_Offset; Right : Address) return Address;
  43.    pragma Convention (Intrinsic, "+");
  44.    pragma Inline ("+");
  45.  
  46.    function "-" (Left : Address; Right : Storage_Offset) return Address;
  47.    pragma Convention (Intrinsic, "-");
  48.    pragma Inline ("-");
  49.  
  50.    function "-" (Left, Right : Address) return Storage_Offset;
  51.    pragma Convention (Intrinsic, "-");
  52.    pragma Inline ("-");
  53.  
  54.    function "mod"
  55.      (Left  : Address;
  56.       Right : Storage_Offset)
  57.       return  Storage_Offset;
  58.    pragma Convention (Intrinsic, "mod");
  59.    pragma Inline ("mod");
  60.  
  61.    --  Conversion to/from integers
  62.  
  63.    type Integer_Address is mod Memory_Size;
  64.  
  65.    function To_Address (Value : Integer_Address) return Address;
  66.    pragma Convention (Intrinsic, To_Address);
  67.    pragma Inline (To_Address);
  68.  
  69.    function To_Integer (Value : Address) return Integer_Address;
  70.    pragma Convention (Intrinsic, To_Integer);
  71.    pragma Inline (To_Integer);
  72.  
  73. end System.Storage_Elements;
  74.